package controllers.tinkerforge;

import models.SensorData;

import org.apache.log4j.Logger;

import ch.bfh.abcm.rems.interfaces.tinkerforge.TFSensorDataPersister;
import ch.bfh.abcm.rems.sensors.tinkerforge.TFSensorType;

public class REMSTFSensorDataPersister implements TFSensorDataPersister {

    private Logger sensorDataLogger = Logger.getLogger("sensorData");

    @Override
    public void saveSensorData(int value, String sensorUID, TFSensorType type) {
        sensorDataLogger.info("Received Sensordata: Type=" + type + " UID=" + sensorUID + " Value=" + value + " "
                + type.getUnit());
        SensorData.saveSensorData(value, sensorUID, type);
    }

}
